|
|
|
|
|
|
|
You can choose from among five types of data entry forms: |
|
|
|
|
|
|
|
|
Single Record. Allows you to edit the information in the recordset one record at a time. This is the classic data entry type of form. |
|
|
|
|
|
|
|
|
Grid (DataSheet). Allows you to edit multiple records at a time. This screen is similar to the recordset view in Access or an Excel spreadsheet. |
|
|
|
|
|
|
|
|
Master/Detail. Allows you to edit the information of a single parent record along with its associated child records. This type of form might be used to show information about an order along with all the items ordered. |
|
|
|
|
|
|
|
|
MS HflexGrid. Creates a grid layout using the new Microsoft Hierarchical FlexGrid control. |
|
|
|
|
|
|
|
|
MS Chart. Creates a chart based on the data. |
|
|
|
|
|
|
|
|
Choosing the type of form to create not only affects the appearance of the form, but also determines what recordset(s) must be selected for the form. For a single record or grid form, you need to select only a single record source. For the Master/Detail form, you need to select two record sources. You really don't have to worry too much about this because the wizard guides you through this process. That's what wizards are for, right? |
|
|
|
|
CAUTION
|
|
|
|
|
If you are creating a Master/Detail form, you first need to establish a relation between the tables you select. The relation information is used to keep the information synchronized. |
|
|
|
|
|
|
|
|
|
|
For the sample project, name the form frmTest1. Select Grid (Datasheet) for the Form Layout. |
|
|
|
|
|
|
|
|
Choosing the Binding Type |
|
|
|
|
|
|
|
|
The standard Jet Data control, which has been around for a long time, uses Data Access Objects (DAOs). However, DAOs are on the way out and will eventually be replaced by the newer ActiveX Data Objects (ADOs). Evidence of this is the fact that in Visual Basic 6, the DFW creates only forms that use ADO. The Binding Type setting on the Form screen in Figure 25.15 allows three options for creating the data form: |
|
|
|
|
|
|
|
|
ADO Data Control. Creates a form with an ADO data control. |
|
|
|
|
|
|
|
|
ADOCode. Uses only code to access the database. |
|
|
|
|
|
|
|
|
Class. Creates a Class module that performs data access. |
|
|
|
|
|
|
|
|
Any one of these methods you select uses the newer ActiveX Data Objects. |
|
|
|
|
|
|
|
|
For our sample project, select ADO Code as the Binding Type. |
|
|
|
|
|
|
|
|
Choosing Fields with the Data Form Wizard |
|
|
|
|
|
|
|
|
After you select the database and the type of form, click Next and you see the Record Source screen, as shown in Figure 25.16. This screen provides a ''friendly" way to choose the table or query to use for the form and the actual fields that you want to have included on the form. |
|
|
|
|
|